package com.nbsaas.boot.data.rest.convert;

import com.nbsaas.boot.data.data.entity.QueryMacro;
import com.nbsaas.boot.data.api.domain.simple.QueryMacroSimple;

import com.nbsaas.boot.rest.api.Converter;
import java.util.HashMap;
import java.util.Map;

/**
* -列表对象转换器
*/

public class QueryMacroSimpleConvert implements Converter<QueryMacroSimple, QueryMacro> {




@Override
public QueryMacroSimple convert(QueryMacro source) {
    QueryMacroSimple result = new QueryMacroSimple();

                result.setName(source.getName());
                result.setRemark(source.getRemark());
                result.setId(source.getId());
                if(source.getMacroType()!=null){
                   Map<Integer,String> MacroTypeMap=new HashMap<>();
                       MacroTypeMap.put(1,"公共宏");
                   String label=  MacroTypeMap.get(source.getMacroType());
                   result.setMacroTypeName(label);
                }
                result.setMacroType(source.getMacroType());
                result.setAddDate(source.getAddDate());
                result.setContent(source.getContent());
                result.setLastDate(source.getLastDate());


    return result;
}

}